﻿using Microsoft.AspNetCore.Mvc;

namespace BillForMVC.Controllers
{
    public class HelloWorldController : Controller
    {
        //每个Controller中的Public方法均可作为HTTP终结点调用
        //每个Public方法就是一个action

        //URL路由逻辑：[Controller]/[ActionName]/[Parameters]

        //GET: /HelloWorld/
        public IActionResult Index()
        {
            return View();
        }
        //GET: /HelloWorld/Welcome/
        public IActionResult Welcome(string name, int numTimes = 1)
        {
            ViewData["Message"] = "Hello " + name;
            ViewData["NumTimes"] = numTimes;
            return View();
        }
    }
}
